package com.slkj.shilixiaoyuanapp.util;

import android.content.Context;
import android.widget.Toast;

import com.slkj.shilixiaoyuanapp.R;
import com.slkj.shilixiaoyuanapp.entity.PeopleEntity;

import java.util.ArrayList;
import java.util.concurrent.TimeUnit;

import io.reactivex.Observable;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.disposables.Disposable;
import io.reactivex.functions.Consumer;
import io.reactivex.schedulers.Schedulers;

/**
 * Created  on 2018-08-06
 *
 * @author 唐开阔
 * @describe 测试环境-测试数据提供器
 */
public class TestDataProvider {
    public static ArrayList<PeopleEntity> getChoseSqrData(){
        ArrayList<PeopleEntity> list = new ArrayList<>();
//        list.add(new PeopleEntity("张强", R.drawable.ic_test_head_1));
//        list.add(new PeopleEntity("王国富",R.drawable.ic_test_head_2));
//        list.add(new PeopleEntity("李毅",R.drawable.ic_test_head_3));
//        list.add(new PeopleEntity("舒洁",R.drawable.ic_test_head_4));
//        list.add(new PeopleEntity("李鑫",R.drawable.ic_test_head_5));
//        list.add(new PeopleEntity("唐武",R.drawable.ic_test_head_5));
//        list.add(new PeopleEntity("李梅",R.drawable.ic_test_head_2));
//        list.add(new PeopleEntity("苏洁",R.drawable.ic_test_head_3));
//        list.add(new PeopleEntity("赵前",R.drawable.ic_test_head_4));
        return list;
    }

    public static void commit(Context context){


        Observable.timer(3, TimeUnit.SECONDS)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .doOnSubscribe(disposable ->{})
                .doOnComplete(() -> {
                    Toast.makeText(context, "提交成功", Toast.LENGTH_SHORT).show();
                }).subscribe();
    }
}
